<?php
/**
 * Created by PhpStorm.
 * User: sundy
 * Date: 2020/2/3
 * Time: 10:11
 */

namespace App\Admin\Controllers;

use Encore\Admin\Controllers\AdminController;
use App\UserBind;
use Encore\Admin\Grid;

class BindAccountController extends AdminController
{
    /**
     * Title for current resource.
     *
     * @var string
     */
    protected $title = '绑定中心';

    /**
     * Make a grid builder.
     *
     * @return Grid
     */
    protected function grid()
    {
        $grid = new Grid(new UserBind);
        $grid->filter(function(Grid\Filter $filter){
            $filter->disableIdFilter();
            $filter->like('vc_account', 'Account');
            $filter->between('dt_bind_time', 'Bind Time')->datetime();
        });
        $grid->quickSearch('vc_account','i_openid','dt_bind_time');

        $grid->column('vc_account', __('Account'))->color('blue')->sortable();;
        $grid->column('i_openid', __('Openid'));
        $grid->column('dt_bind_time', __('Bind Time'));
        $grid->disableExport();
        $grid->disableCreateButton();
        $grid->disableActions();
        $grid->tools(function ($tools) {
            $tools->batch(function ($batch) {
                $batch->disableDelete();
            });
        });
        return $grid;
    }



}
